precision mediump float;
uniform sampler2D vTexture;
varying vec2 aCoord;

void main() {
    vec4 textureColor = texture2D(vTexture, aCoord);

    float redCurveValue = texture2D(vTexture, vec2(textureColor.r, 0.0)).r;
    float greenCurveValue = texture2D(vTexture, vec2(textureColor.g, 0.0)).g;
    float blueCurveValue = texture2D(vTexture, vec2(textureColor.b, 0.0)).b;

    gl_FragColor = vec4(redCurveValue, greenCurveValue, blueCurveValue, textureColor.a);
}
